package org.jeecg.common.util.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author guoyh
 * @ClassName StatusEnum
 * @Description
 * @since 2020/8/13 00:22
 **/
@Getter
@AllArgsConstructor
public enum StatusEnum {

    INVALID(0,"无效"),
    VALID(1,"有效"),;


    private int code;

    private String desc;

    public static StatusEnum getInstance(Integer code){
        return Arrays.stream(values()).filter(item -> Objects.equals(code,item.getCode())).findFirst().orElse(null);
    }


}
